import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  artistInformations: [],
  artists: [],
  artistAlbums: [],
  artistMV: [],
  artistDesc: [],
  actistSimiInfo: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_ARTIST_INFORMATION:
      return state.set("artistInformations", action.Information);
    case actionTypes.GET_ARTISTS:
      return state.set("artists", action.artists);
    case actionTypes.GET_ARTIST_ALBUM:
      return state.set("artistAlbums", action.artistAlbum);
    case actionTypes.GET_ARTIST_MV:
      return state.set("artistMV", action.artistMV);
    case actionTypes.GET_ARTIST_DESC:
      return state.set("artistDesc", action.artistDesc);
    case actionTypes.GET_ARTIST_SIMI:
      return state.set("actistSimiInfo", action.artistSimiInfo);
    default:
      return state;
  }
};

export default a;
